import {query} from '../servers';
import FROMURL from '../exportURL';
import router from '../router/index';
export default {
    modules: {
        xiongxiaokang: {
            namespaced: true,
            //初始数据
            state: {
               nav:[],
            },
            //数据过滤
            getters: {
        
            },
            //同步函数
            mutations: {
                save(state, action){
                    console.log('123',action);
                    action.map(val=>{state[val[0]] = val[1]});
                },
            },
            //异步函数
            actions: {
                async par(context, val){
                    const {data} = await query(FROMURL.navbar,null,'get','arr');
                    console.log('数据:',data);
                    context.commit('save',[['nav',data]]);
                },
             
            },
            //组件嵌套
            modules: []
        }
    }
}